<!DOCTYPE html><meta charset="utf-8" />
<?php
$db=new mysqli("192.168.254.108","firadio_account","123","firadio_account",3306);
$name=$_POST['user_pass_name'];
$sql="SELECT id FROM user_pass WHERE name='$name'";
$r=$db->query($sql);
if($r){
    if($r->fetch_assoc()){
        echo "您输入的[$name]已被注册！";
    }else{
        $begintime=microtime(true);
        $beginipv4=$_SERVER['REMOTE_ADDR'];
        $password=$_POST['user_pass_password'];
        $sql="INSERT INTO user_pass(begintime,beginipv4,`name`,password)VALUES('$begintime','$beginipv4','$name','$password')";
        if($db->query($sql)){
            echo '注册成功！';
        }else{
            echo '注册失败！['.$db->errno.']'.$db->error;
        }
    }
    
}else{
    echo '查询失败！['.$db->errno.']'.$db->error;
}
$db->close();
?>
<form method="post" action="">
用户名称：<input name="user_pass_name" type="text" /><br />
设置密码：<input name="user_pass_password" type="password" /><br />
确认密码：<input name="user_pass_password2" type="password" /><br />
<input type="submit" value="提交" />
</form>